import request from '@/utils/request'

// 查询防盗监控报警日志列表
export function getSecurityLogs(query) {
  return request({
    url: '/security/transmitter/logs',
    method: 'get',
    params: query
  })
}

// 查询防盗监控设备管理列表
export function getSecurityDeviceList(query) {
  return request({
    url: '/security/device/manage',
    method: 'get',
    params: query
  })
}

// 控制防盗监控设备
export function controlSecurityDevice(data) {
  return request({
    url: '/security/device/control',
    method: 'post',
    data: data
  })
}

// 清空防盗监控报警日志
export function clearSecurityLogs() {
  return request({
    url: '/security/device/logs/clear',
    method: 'delete'
  })
}

// 获取防盗监控设备参数设置
export function getSecurityParameters() {
  return request({
    url: '/security/device/parameters',
    method: 'get'
  })
}

// 保存防盗监控设备参数设置
export function saveSecurityParameters(data) {
  return request({
    url: '/security/device/parameters',
    method: 'post',
    data: data
  })
}

// 获取防盗监控设备状态
export function getSecurityDeviceStatus(deviceId) {
  return request({
    url: '/security/device/status/' + deviceId,
    method: 'get'
  })
}

// 更新设备工作模式
export function updateDeviceWorkMode(data) {
  return request({
    url: '/security/device/workmode',
    method: 'post',
    data: data
  })
}